package com.sl.hx.shop.utils;

import java.text.DecimalFormat;

/**
 * @Author hwg
 * @Description：价格工具类
 * @Date 2018/2/6
 */
public class PriceUtil {

    private static DecimalFormat mPriceFormat ;

    /**
     * 价格格式化，保留小数点后两位
     * @param price
     * @return
     */
    public static String priceFormat(Double price){
        if (mPriceFormat == null){
            mPriceFormat = new DecimalFormat("#0.00") ;
        }
        return mPriceFormat.format(price) ;
    }

}
